package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id          uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	Username    string         `gorm:"column:username;type:varchar(255);comment:账号;not null;" json:"username"`                                 // 账号
	Password    string         `gorm:"column:password;type:varchar(255);comment:密码;not null;" json:"password"`                                 // 密码
	CreatedTime time.Time      `gorm:"column:created_time;type:datetime;comment:创建时间;not null;default:CURRENT_TIMESTAMP;" json:"created_time"` // 创建时间
	UploadTime  time.Time      `gorm:"column:upload_time;type:datetime;comment:修改时间;not null;default:CURRENT_TIMESTAMP;" json:"upload_time"`   // 修改时间
	DeletedTime gorm.DeletedAt `gorm:"column:deleted_time;type:datetime;comment:删除时间;default:NULL;" json:"deleted_time"`                       // 删除时间
}

func (User) TableName() string {
	return "user"
}
